/**
 * 图片推荐模型
 * @props priority       优先级
 * @props show           是否展示
 * @props imgUrl         图片地址
 * @props url            跳转地址
 * @props urlParams      跳转参数
 * @props des            描述信息
 * @props tags           标签
 */
export default function (app) {
  const { STRING, INTEGER, DATE, BOOLEAN, JSONB, ARRAY } = app.Sequelize;
  const Advisement = app.model.define('advisement', {
    priority: INTEGER,
    show: { type: BOOLEAN, defaultValue: false },
    imgUrl: { type: STRING, allowNull: false },
    url: { type: STRING, allowNull: false },
    urlParams: { type: JSONB },
    des: STRING,
    tags: ARRAY(STRING(20)),
    createdAt: DATE,
    updatedAt: DATE
  });

  return Advisement;
}
